import textwrap

sample_text = """
    This is an example text.
        It has some indentation and 
            varying levels of it.
"""
dedented_text = textwrap.dedent(sample_text).strip()
print(dedented_text)